﻿/*************************************************************
 * Software of blackcore
 *
 * CLRVersion:4.0.30319.586
 * MachineName:SPACE
 * Author:Andy Huang
 * Email:itblackhole@gmail.com
 * DateTime：6/25/2013 5:15:32 PM
 * Function：
 *************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using SobFS.DALFactory;
using SobFS.Common;
using SobFS.Common.Database;

namespace SobFS.BLL
{
    public partial class SysFunctionMenu
    {
        #region ******************************Private Property******************************        
        #endregion ******************************Private Property******************************


        #region ******************************Public Property******************************
        #endregion ******************************Public Property******************************


        #region ******************************Structure******************************
        #endregion  ******************************Structure******************************


        #region ******************************Private Method******************************
        #endregion ******************************Private Method******************************


        #region ******************************Public Method******************************
        /// <summary>
        /// 得到一个对象实体，从缓存中
        /// </summary>
        public SobFS.Model.SysFunctionMenu GetModelByCache(int Id)
        {
            string cacheKey = typeof(SobFS.Model.SysFunctionMenu).Name + Id;
            object objModel = DbCacheHelper.GetCache(cacheKey);
            if (objModel == null)
            {
                try
                {
                    objModel = dal.GetModel(Id);
                    if (objModel != null)
                    {
                        int modelCache = ConfigHelper.GetConfigInt("modelCache");
                        DbCacheHelper.SetCache(cacheKey, objModel, DateTime.Now.AddMinutes(modelCache), TimeSpan.Zero);
                    }
                }
                catch { }
            }

            return (SobFS.Model.SysFunctionMenu)objModel;
        }

        public DataSet GetList(string strWhere, string orderBy)
        {
            return dal.GetList(strWhere, orderBy);
        }
        /// <summary>
        /// 获得查询分页数据
        /// </summary>
        public DataSet GetList(int pageSize, int pageIndex, string strWhere, string filedOrder, out int recordCount)
        {
            return dal.GetList(pageSize, pageIndex, strWhere, filedOrder, out recordCount);
        }
        #endregion ******************************Public Method******************************
    }
}
